| Filename | (eval 1115)[/usr/share/perl5/CGI.pm:932] |
| Statements | Executed 6 statements in 16µs |
| Eval Invoked At | /usr/share/perl5/CGI.pm line 932 |
| Sibling evals | 1, 2, 3, 4 |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 8 | 2 | 1 | 26µs | 26µs | CGI::CORE:regcomp (opcode) |
| 7 | 4 | 2 | 11µs | 11µs | CGI::CORE:match (opcode) |
| 6 | 3 | 2 | 5µs | 5µs | CGI::CORE:subst (opcode) |
| 2 | 1 | 1 | 2µs | 2µs | CGI::CORE:substcont (opcode) |
| 0 | 0 | 0 | 0s | 0s | CGI::unescapeHTML |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package CGI; sub unescapeHTML { | ||||
| 2 | # hack to work around earlier hacks | ||||
| 3 | 1 | 400ns | push @_,$_[0] if @_==1 && $_[0] eq 'CGI'; | ||
| 4 | 1 | 6µs | 1 | 2µs | my ($self,$string) = CGI::self_or_default(@_); # spent 2µs making 1 call to CGI::self_or_default |
| 5 | 1 | 100ns | return undef unless defined($string); | ||
| 6 | 1 | 6µs | 1 | 600ns | my $latin = defined $self->{'.charset'} ? $self->{'.charset'} =~ /^(ISO-8859-1|WINDOWS-1252)$/i # spent 600ns making 1 call to CGI::CORE:match |
| 7 | : 1; | ||||
| 8 | # thanks to Randal Schwartz for the correct solution to this one | ||||
| 9 | 1 | 3µs | 1 | 800ns | $string=~ s[&([^\s&]*?);]{ # spent 800ns making 1 call to CGI::CORE:subst |
| 10 | local $_ = $1; | ||||
| 11 | /^amp$/i ? "&" : | ||||
| 12 | /^quot$/i ? '"' : | ||||
| 13 | /^gt$/i ? ">" : | ||||
| 14 | /^lt$/i ? "<" : | ||||
| 15 | /^#(\d+)$/ && $latin ? chr($1) : | ||||
| 16 | /^#x([0-9a-f]+)$/i && $latin ? chr(hex($1)) : | ||||
| 17 | "&$_;" | ||||
| 18 | }gex; | ||||
| 19 | 1 | 700ns | return $string; | ||
| 20 | } | ||||
| 21 | |||||
| 22 | ; | ||||
# spent 11µs within CGI::CORE:match which was called 7 times, avg 2µs/call:
# 4 times (4µs+0s) by CGI::header at line 31 of (eval 1114)[CGI.pm:932], avg 1µs/call
# once (6µs+0s) by CGI::header at line 50 of (eval 1114)[CGI.pm:932]
# once (600ns+0s) by CGI::unescapeHTML at line 6
# once (600ns+0s) by CGI::header at line 54 of (eval 1114)[CGI.pm:932] | |||||
# spent 26µs within CGI::CORE:regcomp which was called 8 times, avg 3µs/call:
# 4 times (17µs+0s) by CGI::header at line 31 of (eval 1114)[CGI.pm:932], avg 4µs/call
# 4 times (10µs+0s) by CGI::header at line 28 of (eval 1114)[CGI.pm:932], avg 2µs/call | |||||
# spent 5µs within CGI::CORE:subst which was called 6 times, avg 800ns/call:
# 4 times (2µs+0s) by CGI::header at line 28 of (eval 1114)[CGI.pm:932], avg 450ns/call
# once (2µs+0s) by CGI::header at line 51 of (eval 1114)[CGI.pm:932]
# once (800ns+0s) by CGI::unescapeHTML at line 9 | |||||
# spent 2µs within CGI::CORE:substcont which was called 2 times, avg 1µs/call:
# 2 times (2µs+0s) by CGI::header at line 51 of (eval 1114)[CGI.pm:932], avg 1µs/call |